﻿
#include <windows.h>
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>

int main()
{
	// 要么设置OSG_LIBRARY_PATH环境变量为plugin_xxx文件夹的路径，要么osgdb_fs.dll要放到应用程序exe的同一个路径下面！
	osgDB::Registry::instance()->addFileExtensionAlias("fs", "fs");//将文件扩展名与dll名关联起来

	osg::ref_ptr<osg::Group> group = new osg::Group;
	group->addChild(osgDB::readNodeFile("sphere.fs")); // 自定义的fs文件

	osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
	viewer->setUpViewInWindow(100, 100, 1500, 1000);
	viewer->setSceneData(group.get());
	viewer->run();
	return 0;
}